﻿<Frame x:Class="StockManagement.Views.ProductGrid"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008">
    <Frame.Content>
        <Grid Grid.Column="1" Grid.RowSpan="3" x:Name="_mainGrid">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="*"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
            </Grid.RowDefinitions>

            <StackPanel Orientation="Horizontal" Margin="5" Visibility="Visible">
                <Label Margin="2" Padding="3" Content="Product Status" Height="23"></Label>
                <ComboBox x:Name="cmbShowProductsDG" IsEditable="False" MinWidth="80" Margin="2" 
                              ItemsSource="{Binding Source={StaticResource dgShowProducts}}" 
                               SelectedItem="{Binding Path=ShowProduct}"
                              VerticalAlignment="Center" HorizontalAlignment="Stretch" Padding="3">
                </ComboBox>
            </StackPanel>
            <StackPanel Grid.Row="2">
                <Button Command="{Binding Path=ExportToExcelCommand}">Export To Excel</Button>
            </StackPanel>
            <DataGrid x:Name="_datagridMaterials" Grid.Row="1" ItemsSource="{Binding Path=ProductCollection}"
                      HorizontalContentAlignment="Stretch">
                <DataGrid.Columns>
                    <DataGridTextColumn Header="Name" Binding="{Binding Path=ProductName}" IsReadOnly="True" />
                    <DataGridTextColumn Header="Code" Binding="{Binding Path=ProductCode}" IsReadOnly="True"/>
                    <DataGridTextColumn Header="Type" Binding="{Binding Path=ProductType}" IsReadOnly="True"/>
                    <DataGridTextColumn Header="Consumer" Binding="{Binding Path=Consumer}" IsReadOnly="True" Visibility="{Binding Path=ShowConsumer,Mode=OneWay}"/>
                    <DataGridTextColumn Header="Purchaser" Binding="{Binding Path=Purchaser}" IsReadOnly="True" Visibility="{Binding Path=ShowPurchaser,Mode=OneWay}"/>
                    <DataGridTextColumn Header="Status" Binding="{Binding Path=ProductStatus}" IsReadOnly="True"/>
                    <DataGridTextColumn Header="Date" Binding="{Binding Path=Date}" IsReadOnly="True"/>
                </DataGrid.Columns>
            </DataGrid>
        </Grid>
    </Frame.Content>
</Frame>
